// JosephusCircle.h
#pragma once

struct Node
{
    int data;
    Node *next;
    Node(int value, Node *ptr = nullptr) : data(value), next(ptr) {}
};

class JosephusCircle
{
public:
    JosephusCircle(int size);
    ~JosephusCircle(); // 添加析构函数以释放内存
    void findSurvivor(int m);
    void display();

private:
    Node *m_head;
};